/**
 * author: wangcheng
 * date: 2018/08/17
 * des: 待我审批
 *
 */
import {
  getPositionApi,
  getRankApi
} from './api'
/**
 * 高级搜索
 */
export const searchSetting = [{
  field: 'employeeNo',
  title: '员工编号',
  type: 'text',
  searchable: true
},
{
  field: 'employeeName',
  title: '员工名称',
  type: 'text',
  searchable: true
},
{
  field: 'status',
  title: '状态',
  type: 'selected',
  searchable: true,
  options: [{
    name: '退回待修改',
    value: '0'
  },
  {
    name: '填写动薪',
    value: '1'
  },
  {
    name: '审批中',
    value: '5'
  },
  { // 0 待提交 1 审批中  2 审批通过 9 已放弃
    name: '审批通过',
    value: '2'
  },
  {
    name: '已放弃',
    value: '9'
  }
  ]
},
{
  field: 'orgId',
  title: '部门',
  type: 'org',
  searchable: true
},
{
  field: 'post',
  title: '岗位',
  type: 'selected',
  isParams: true,
  paramsId: 'POST',
  searchable: true
},
// {
//   field: 'postLevel',
//   title: '职级',
//   type: 'selected',
//   isParams: true,
//   paramsId: 'RANK',
//   searchable: true
// },
{
  field: 'entryDate',
  title: '入职日期',
  type: 'date',
  searchable: true
}
]







export const entryListSetting = [{
  field: 'id',
  title: 'id',
  type: 'text',
  isHiden: true
},
{
  field: 'employeeNo',
  title: '员工编号',
  type: 'text',
  searchable: true
},
{
  field: 'employeeName',
  title: '员工名称',
  type: 'text',
  searchable: true
},
{
  field: 'orgName',
  title: '部门',
  type: 'text',
  searchable: true
},
{
  field: 'targetPost',
  title: '岗位',
  type: 'selected',
  isParams: true,
  paramsId: 'POST',
  searchable: true
},
{
  field: 'targetPostLevel',
  title: '职级',
  type: 'selected',
  isParams: true,
  paramsId: 'RANK',
  searchable: true
},
{
  field: 'entryDate',
  title: '入职日期',
  type: 'date',
  searchable: true
},
{
  field: 'statusName',
  title: '状态',
  type: 'text'
},
{
  field: 'status',
  title: '状态',
  type: 'text',
  isHiden: true
},

{
  field: 'taskDefKey',
  title: 'taskDefKey',
  type: 'text',
  isHiden: true
}
]


/**
 * 入职详情set
 */

export const entryDetailSetting = [{
  field: 'id',
  title: 'id',
  type: 'text',
  hideDetail: true
},
{
  field: 'employeeNo',
  title: '员工编号',
  type: 'text'
},
{
  field: 'employeeName',
  title: '员工名称',
  type: 'text'
}, {
  field: 'targetOrgId',
  title: '部门',
  type: 'org'
},
{
  field: 'targetPost',
  title: '岗位',
  type: 'selected',
  isParams: true,
  paramsId: 'POST'
}, {
  field: 'targetPostLevel',
  title: '职级',
  type: 'selected',
  isParams: true,
  paramsId: 'RANK'
},
{
  field: 'entryDate',
  title: '入职日期',
  type: 'date',
  searchable: true
}, {
  field: 'targetWorkAddr',
  title: '工作地点',
  type: 'selected',
  isParams: true,
  paramsId: 'WORKPLACE'
},
{
  field: 'targetCompany',
  title: '合同公司',
  type: 'contract-company'
},
{
  field: 'effectDate',
  title: '生效日期',
  type: 'date'
}
]

/**
 * 入职审批set
 */

export const entryApproveSetting = [{
  field: 'id',
  title: 'id',
  type: 'text',
  hideEdit: true
},
{
  field: 'employeeNo',
  title: '员工编号',
  type: 'text',
  disableEdit: true
},
{
  field: 'employeeName',
  title: '员工名称',
  type: 'text'
},
{
  field: 'targetOrgId',
  title: '部门',
  type: 'org',
  info: '部门、岗位、职级为三级联动：部门 > 岗位 > 职级',
  init: (form, item) => {
    const params = {
      orgId: form.targetOrgId
    }
    const options = []
    getPositionApi(params).then(response => {
      if (response.success) {
        let data = []
        if (response.data) {
          data = response.data
        }
        data.forEach(v => {
          const a = {
            name: v.postName,
            value: v.postId
          }
          options.push(a)
        })
        entryApproveSetting.forEach(v => {
          if (v.field === 'targetPost') {
            v.options = options
          }
        })
      }
    })
  },
  itemChange: (form, b, c) => {
    const params = {
      orgId: form.targetOrgId
    }
    const options = []
    getPositionApi(params).then(response => {
      if (response.success) {
        let data = []
        if (response.data) {
          data = response.data
        }
        data.forEach(v => {
          const a = {
            name: v.postName,
            value: v.postId
          }
          options.push(a)
        })
        entryApproveSetting.forEach(v => {
          if (v.field === 'targetPost') {
            v.options = []
            form.targetPost = ''
            v.options = options
          }
          if (v.field === 'targetPostLevel') {
            form.targetPostLevel = ''
          }
        })
      }
    })
  }
},
{
  field: 'targetPost',
  title: '岗位',
  type: 'selected',
  info: '部门、岗位、职级为三级联动：部门 > 岗位 > 职级',
  options: [],
  init: (form, item) => {
    if (form.targetOrgId && form.targetPost) {
      const params = {
        orgId: form.targetOrgId,
        postId: form.targetPost
      }
      const options = []
      getRankApi(params).then(response => {
        if (response.success) {
          if (response.data) {
            response.data.forEach(v => {
              const a = {
                name: v.name,
                value: v.id
              }
              options.push(a)
            })
            entryApproveSetting.forEach(v => {
              if (v.field === 'targetPostLevel') {
                v.options = options
              }
            })
          }
        }
      })
    }
  },
  itemChange: (form, item) => {
    if (form.targetOrgId && form.targetPost) {
      const params = {
        orgId: form.targetOrgId,
        postId: form.targetPost
      }
      const options = []
      getRankApi(params).then(response => {
        if (response.success) {
          if (response.data) {
            response.data.forEach(v => {
              const a = {
                name: v.name,
                value: v.id
              }
              options.push(a)
            })
            entryApproveSetting.forEach(v => {
              if (v.field === 'targetPostLevel') {
                form.targetPostLevel = ''
                v.options = options
              }
            })
          }
        }
      })
    }
  }
}, {
  field: 'targetPostLevel',
  info: '部门、岗位、职级为三级联动：部门 > 岗位 > 职级',
  title: '职级',
  type: 'selected',
  options: []
},
{
  field: 'entryDate',
  title: '入职日期',
  type: 'date'
},
{
  field: 'targetWorkAddr',
  title: '工作地点',
  type: 'selected',
  isParams: true,
  paramsId: 'WORKPLACE'
}, {
  field: 'targetCompany',
  title: '合同公司',
  type: 'contract-company'
},

{
  field: 'docList',
  title: '简历附件',
  type: 'file',
  busiKey: 'employeeNo'
},
{
  field: 'taskId',
  title: 'taskId',
  type: 'text',
  disableEdit: true,
  hideEdit: true
},
{
  field: 'action',
  title: 'action',
  type: 'text',
  disableEdit: true,
  hideEdit: true
},
{
  field: 'taskDefKey',
  title: 'taskDefKey',
  type: 'text',
  disableEdit: true,
  hideEdit: true
},
{
  field: 'procInstId',
  title: 'procInstIdww',
  type: 'text',
  disableEdit: true,
  hideEdit: true
}
]

/**
 * 延期列表的set
 */

export const delayListSetting = [{
  field: 'id',
  title: 'id',
  type: 'text',
  isHiden: true
},
{
  field: 'employeeNo',
  title: '员工编号',
  type: 'text',
  searchable: true
},
{
  field: 'employeeName',
  title: '员工名称',
  type: 'text',
  searchable: true
},
{
  field: 'orgName',
  title: '部门',
  type: 'text',
  searchable: true
},
{
  field: 'position',
  title: '岗位',
  type: 'selected',
  isParams: true,
  paramsId: 'POST',
  searchable: true
},
{
  field: 'entryDate',
  title: '入职日期',
  type: 'date',
  searchable: true
},
{
  field: 'planCorrectionDate',
  title: '计划转正日期',
  type: 'date'
},
{
  field: 'delayCorrectionDate',
  title: '延期转正日期',
  type: 'date'
},
{
  field: 'delayReason',
  title: '延期原因',
  type: 'text'
},
{
  field: 'statusName',
  title: '状态',
  type: 'text'
},
{
  field: 'status',
  title: '状态',
  type: 'text',
  isHiden: true
}
]


/**
 * 延期详情set
 */

export const delayDetailSetting = [{
  field: 'id',
  title: 'id',
  type: 'text',
  hideDetail: true
},
{
  field: 'employeeNo',
  title: '员工编号',
  type: 'text'
},
{
  field: 'employeeName',
  title: '员工名称',
  type: 'text'
},
{
  field: 'planCorrectionDate',
  title: '计划转正日期',
  type: 'date'
},
{
  field: 'delayCorrectionDate',
  title: '延期转正日期',
  type: 'date'
},
{
  field: 'delayReason',
  title: '延期原因',
  type: 'text'
}
]

/**
 * 延期详情set
 */

export const delayApproveSetting = [{
  field: 'id',
  title: 'id',
  type: 'text',
  hideEdit: true
},
{
  field: 'employeeNo',
  title: '员工编号',
  type: 'text',
  disableEdit: true
},
{
  field: 'employeeName',
  title: '员工名称',
  type: 'text',
  disableEdit: true
},
{
  field: 'planCorrectionDate',
  title: '计划转正日期',
  type: 'date',
  disableEdit: true
},
{
  field: 'delayCorrectionDate',
  title: '延期转正日期',
  type: 'date'
},
{
  field: 'delayReason',
  title: '延期原因',
  type: 'text'
}, {
  field: 'approvalOpinion',
  title: '审批意见',
  type: 'textarea',
  onlyRow: true
},
{
  field: 'taskId',
  title: 'taskId',
  type: 'text',
  disableEdit: true,
  hideEdit: true
},
{
  field: 'action',
  title: 'action',
  type: 'text',
  disableEdit: true,
  hideEdit: true
},
{
  field: 'taskDefKey',
  title: 'taskDefKey',
  type: 'text',
  disableEdit: true,
  hideEdit: true
},
{
  field: 'procInstId',
  title: 'procInstIdww',
  type: 'text',
  disableEdit: true,
  hideEdit: true
}
]
/**
 * 转正的list
 */
export const conrrectionListSetting = [{
  field: 'id',
  title: 'id',
  type: 'text',
  isHiden: true
},
{
  field: 'employeeNo',
  title: '员工编号',
  type: 'text'
},
{
  field: 'employeeName',
  title: '员工名称',
  type: 'text'
},
{
  field: 'orgName',
  title: '部门',
  type: 'text'
},
{
  field: 'targetPost',
  title: '岗位',
  type: 'selected',
  isParams: true,
  paramsId: 'POST'
}, {
  field: 'targetPostLevel',
  title: '职级',
  type: 'selected',
  isParams: true,
  paramsId: 'RANK'
},
{
  field: 'entryDate',
  title: '入职日期',
  type: 'date'
},
{
  field: 'workNature',
  title: '工作性质',
  type: 'selected',
  isParams: true,
  paramsId: 'NATUREWORK'
}, {
  field: 'planCorrectionDate',
  title: '计划转正日期',
  type: 'date'
},
{
  field: 'conrrectionDate',
  title: '实际转正日期',
  type: 'date'
},
{
  field: 'statusName',
  title: '状态',
  type: 'text'
},
{
  field: 'status',
  title: '状态',
  type: 'text',
  isHiden: true
},
{
  field: 'taskDefKey',
  title: 'taskDefKey',
  type: 'text',
  isHiden: true
}
]

/**
 * 转正的详情
 */
export const conrrectionDetailSetting = [{
  field: 'id',
  title: 'id',
  type: 'text',
  hideDetail: true
},
{
  field: 'employeeNo',
  title: '员工编号',
  type: 'text'
},
{
  field: 'employeeName',
  title: '员工名称',
  type: 'text'
},
{
  field: 'originalOrgId',
  title: '原部门',
  type: 'org',
  disableEdit: true
}, {
  field: 'targetOrgId',
  title: '目标部门',
  type: 'org'
},
{
  field: 'originalPost',
  title: '原岗位',
  type: 'selected',
  isParams: true,
  paramsId: 'POST',
  disableEdit: true
}, {
  field: 'targetPost',
  title: '目标岗位',
  type: 'selected',
  isParams: true,
  paramsId: 'POST'
}, {
  field: 'originalPostLevel',
  title: '原职级',
  type: 'selected',
  isParams: true,
  paramsId: 'RANK',
  disableEdit: true
},

{
  field: 'targetPostLevel',
  title: '目标职级',
  type: 'selected',
  isParams: true,
  paramsId: 'RANK'
},
{
  field: 'conrrectionDate',
  title: '实际转正日期',
  type: 'date'
},
{
  field: 'entryDate',
  title: '入职日期',
  type: 'date'
},

{
  field: 'companyEmail',
  title: '工作邮箱',
  type: 'text',
  disableEdit: true
},

{
  field: 'planCorrectionDate',
  title: '计划转正日期',
  type: 'date',
  disableEdit: true
},

{
  field: 'attachid',
  title: '附件',
  type: 'text',
  disableEdit: true
},
{
  field: 'taskDefName',
  title: '状态',
  type: 'text',
  disableEdit: true
}
]

/**
 * 转正的审批
 */
export const conrrectionApproveSetting = [{
  field: 'id',
  title: 'id',
  type: 'text',
  hideEdit: true
},
{
  field: 'employeeNo',
  title: '员工编号',
  type: 'text',
  disableEdit: true
},
{
  field: 'employeeName',
  title: '员工名称',
  type: 'text',
  disableEdit: true
},


{
  field: 'originalOrgId',
  title: '原部门',
  type: 'org',
  disableEdit: true
},


{
  field: 'targetOrgId',
  title: '目标部门',
  type: 'org',
  init: (form, item) => {
    const params = {
      orgId: form.targetOrgId
    }
    const options = []
    getPositionApi(params).then(response => {
      if (response.success) {
        let data = []
        if (response.data) {
          data = response.data
        }
        data.forEach(v => {
          const a = {
            name: v.postName,
            value: v.postId
          }
          options.push(a)
        })
        conrrectionApproveSetting.forEach(v => {
          if (v.field === 'targetPost') {
            v.options = options
          }
        })
      }
    })
  },
  itemChange: (form, b, c) => {
    const params = {
      orgId: form.targetOrgId
    }
    const options = []
    getPositionApi(params).then(response => {
      if (response.success) {
        let data = []
        if (response.data) {
          data = response.data
        }
        data.forEach(v => {
          const a = {
            name: v.postName,
            value: v.postId
          }
          options.push(a)
        })
        conrrectionApproveSetting.forEach(v => {
          if (v.field === 'targetPost') {
            v.options = []
            form.targetPost = ''
            v.options = options
          }
          if (v.field === 'targetPostLevel') {
            form.targetPostLevel = ''
          }
        })
      }
    })
  }
},
{
  field: 'originalPost',
  title: '原岗位',
  type: 'selected',
  isParams: true,
  paramsId: 'POST',
  disableEdit: true
},
{
  field: 'targetPost',
  title: '目标岗位',
  type: 'selected',
  options: [],
  init: (form, item) => {
    if (form.targetOrgId && form.targetPost) {
      const params = {
        orgId: form.targetOrgId,
        postId: form.targetPost
      }
      const options = []
      getRankApi(params).then(response => {
        if (response.success) {
          if (response.data) {
            response.data.forEach(v => {
              const a = {
                name: v.name,
                value: v.id
              }
              options.push(a)
            })
            conrrectionApproveSetting.forEach(v => {
              if (v.field === 'targetPostLevel') {
                v.options = options
              }
            })
          }
        }
      })
    }
  },
  itemChange: (form, item) => {
    if (form.targetOrgId && form.targetPost) {
      const params = {
        orgId: form.targetOrgId,
        postId: form.targetPost
      }
      const options = []
      getRankApi(params).then(response => {
        if (response.success) {
          if (response.data) {
            response.data.forEach(v => {
              const a = {
                name: v.name,
                value: v.id
              }
              options.push(a)
            })
            conrrectionApproveSetting.forEach(v => {
              if (v.field === 'targetPostLevel') {
                form.targetPostLevel = ''
                v.options = options
              }
            })
          }
        }
      })
    }
  }
},

{
  field: 'originalPostLevel',
  title: '原职级',
  type: 'selected',
  isParams: true,
  paramsId: 'RANK',
  disableEdit: true
},

{
  field: 'targetPostLevel',
  title: '目标职级',
  type: 'selected',
  options: []
},
{
  field: 'conrrectionDate',
  title: '实际转正日期',
  type: 'date'
},
{
  field: 'entryDate',
  title: '入职日期',
  type: 'date',
  disableEdit: true
},

{
  field: 'companyEmail',
  title: '工作邮箱',
  type: 'text',
  disableEdit: true
},

{
  field: 'planCorrectionDate',
  title: '计划转正日期',
  type: 'date',
  disableEdit: true
},

{
  field: 'attachid',
  title: '附件',
  type: 'text',
  disableEdit: true
},
{
  field: 'taskDefName',
  title: '状态',
  type: 'text',
  disableEdit: true
}, {
  field: 'approvalOpinion',
  title: '审批意见',
  type: 'textarea',
  onlyRow: true
},
{
  field: 'taskId',
  title: 'taskId',
  type: 'text',
  disableEdit: true,
  hideEdit: true
},
{
  field: 'action',
  title: 'action',
  type: 'text',
  disableEdit: true,
  hideEdit: true
},
{
  field: 'taskDefKey',
  title: 'taskDefKey',
  type: 'text',
  disableEdit: true,
  hideEdit: true
},
{
  field: 'procInstId',
  title: 'procInstIdww',
  type: 'text',
  disableEdit: true,
  hideEdit: true
}
]

/**
 * 调动的list
 */
export const turnoverListSetting = [{
  field: 'id',
  title: 'id',
  type: 'text',
  isHiden: true
},
{
  field: 'employeeNo',
  title: '员工编号',
  type: 'text'
},
{
  field: 'employeeName',
  title: '员工名称',
  type: 'text'
},
{
  field: 'originalOrgId',
  title: '原部门',
  type: 'org'

}, {
  field: 'targetOrgId',
  title: '目标部门',
  type: 'org'
},
{
  field: 'originalPost',
  title: '原岗位',
  type: 'selected',
  isParams: true,
  paramsId: 'POST'
}, {
  field: 'targetPost',
  title: '目标岗位',
  type: 'selected',
  isParams: true,
  paramsId: 'POST'
}, {
  field: 'originalPostLevel',
  title: '原职级',
  type: 'selected',
  isParams: true,
  paramsId: 'RANK',
  disableEdit: true
}, {
  field: 'targetPostLevel',
  title: '目标职级',
  type: 'selected',
  isParams: true,
  paramsId: 'RANK'
},
{
  field: 'entryDate',
  title: '入职日期',
  type: 'date'
},
{
  field: 'statusName',
  title: '状态',
  type: 'text'
},
{
  field: 'status',
  title: '状态',
  type: 'text',
  isHiden: true
},
{
  field: 'taskDefKey',
  title: 'taskDefKey',
  type: 'text',
  isHiden: true
}
]

/**
 * 调动的详情
 */
export const turnoverDetailSetting = [{
  field: 'id',
  title: 'id',
  type: 'text',
  hideDetail: true
},
{
  field: 'employeeNo',
  title: '员工',
  type: 'text',
  disableEdit: true
}, {
  field: 'employeeName',
  title: '员工名称',
  type: 'text',
  disableEdit: true
}, {
  field: 'turnoverType',
  title: '异动类型',
  type: 'radio',
  disableEdit: true,
  customText: (item) => {
    switch (item.turnoverType) {
      case '4':
        return '降级'
      case '3':
        return '晋升'
      case '5':
        return '调岗'
    }
  },
  optional: [{
    name: '调岗',
    value: '5'
  },
  {
    name: '晋升',
    value: '3'
  },
  {
    name: '降级',
    value: '4'
  }
  ]
}, {
  field: 'entryDate',
  title: '入职日期',
  type: 'date',
  disableEdit: true
},
{
  field: 'originalOrgId',
  title: '原部门',
  type: 'org',
  disableEdit: true
},
{
  field: 'targetOrgId',
  title: '目标部门',
  type: 'org',
  disableEdit: true
},
{
  field: 'originalPost',
  title: '原岗位',
  type: 'text',
  disableEdit: true
},
{
  field: 'targetPost',
  title: '目标岗位',
  type: 'text',
  disableEdit: true
},

{
  field: 'originalPostLevel',
  title: '原职级',
  type: 'selected',
  isParams: true,
  paramsId: 'RANK',
  disableEdit: true
},

{
  field: 'targetPostLevel',
  title: '目标职级',
  type: 'selected',
  isParams: true,
  paramsId: 'RANK',
  disableEdit: true
},
{
  field: 'originalSalary',
  title: '原薪资',
  type: 'text',
  disableEdit: true
}, {
  field: 'targetSalary',
  title: '目标薪资',
  type: 'text'
}, {
  field: 'originalBaseSalary',
  title: '原基本底薪',
  type: 'text',
  disableEdit: true
}, {
  field: 'targetBaseSalary',
  title: '目标基本底薪',
  type: 'text'
}, {
  field: 'originalPostSalary',
  title: '原岗位工资',
  type: 'text',
  disableEdit: true
}, {
  field: 'targetPostSalary',
  title: '目标岗位工资',
  type: 'text'
},
{
  field: 'originalAllowance',
  title: '原岗位津贴',
  type: 'text',
  disableEdit: true
}, {
  field: 'targetAllowance',
  title: '目标岗位津贴',
  type: 'text'
}, {
  field: 'originalAchievementBonus',
  title: '原绩效奖金',
  type: 'text',
  disableEdit: true
}, {
  field: 'targetAchievementBonus',
  title: '目标绩效奖金',
  type: 'text'
}, {
  field: 'originalFullattendReward',
  title: '原全勤奖',
  type: 'text',
  disableEdit: true
}, {
  field: 'targetFullattendReward',
  title: '目标全勤奖',
  type: 'text'
}, {
  field: 'originalOtherReward',
  title: '原其他',
  type: 'text',
  disableEdit: true
}, {
  field: 'targetOtherReward',
  title: '其他',
  type: 'text'
}, {
  field: 'effectDate',
  title: '生效日期',
  type: 'date'
},
{
  field: 'remarks',
  title: '备注',
  type: 'textarea'
}
]
export const changeRosterFormDetail = [
  {
    field: 'employeeName',
    title: '员工姓名',
    type: 'text',
    disableEdit: true
  },
  {
    field: 'employeeNo',
    title: '员工号',
    type: 'text',
    disableEdit: true
  },
  {
    field: 'workNature',
    title: '工作性质',
    type: 'selected',
    isParams: true,
    paramsId: 'NATUREWORK',
    disableEdit: true
  },
  {
    field: 'employeeStatus',
    title: '员工状态',
    type: 'selected',
    isParams: true,
    paramsId: 'EMPLOYEESTATUS',
    disableEdit: true
  },
  {
    field: 'turnoverType',
    title: '异动类型',
    type: 'radio',
    optional: [
      {
        name: '调岗',
        value: '5'
      },
      {
        name: '晋升',
        value: '3'
      },
      {
        name: '降级',
        value: '4'
      }
    ]
  },
  {
    field: 'turnoverCause',
    title: '异动原因',
    type: 'radio',
    optional: [
      {
        name: '工作安排',
        value: '1'
      },
      {
        name: '个人申请',
        value: '2'
      }
    ]
  },
  {
    field: 'originalOrgId',
    title: '原部门',
    type: 'org',
    disableEdit: true
  },
  {
    field: 'targetOrgId',
    title: '变更部门',
    type: 'org'
  },
  {
    field: 'originalPost',
    title: '原岗位',
    type: 'selected',
    isParams: true,
    paramsId: 'POST',
    disableEdit: true
  },
  {
    field: 'targetPost',
    title: '变更岗位',
    info: '部门、岗位、职级为三级联动：部门 > 岗位 > 职级',
    type: 'selected',
    isParams: true,
    paramsId: 'POST',

  },
  {
    field: 'originalPostLevel',
    title: '原职级',
    type: 'selected',
    isParams: true,
    paramsId: 'RANK',
    disableEdit: true
  },
  {
    field: 'targetPostLevel',
    title: '变更职级',
    info: '部门、岗位、职级为三级联动：部门 > 岗位 > 职级',
    type: 'selected',
    isParams: true,
    paramsId: 'RANK',
  },
  {
    field: 'originalWorkAddr',
    title: '原工作地址',
    type: 'selected',
    isParams: true,
    disableEdit: true,
    paramsId: 'WORKPLACE'
  },
  {
    field: 'targetWorkAddr',
    title: '变更工作地址',
    type: 'selected',
    isParams: true,
    paramsId: 'WORKPLACE'
  },
  {
    field: 'originalCompany',
    title: '原合同公司',
    type: 'contract-company',
    disableEdit: true
  },
  {
    field: 'targetCompany',
    title: '变更合同公司',
    type: 'contract-company',
  },
  {
    field: 'effectDate',
    title: '生效日期',
    type: 'date'
  },

  {
    field: 'remarks',
    title: '备注',
    type: 'text'
  }
]

/**
 * 人事异动
 */
export const changeRosterForm = [
  {
    field: 'employeeName',
    title: '员工姓名',
    type: 'text',
    disableEdit: true
  },
  {
    field: 'employeeNo',
    title: '员工号',
    type: 'text',
    disableEdit: true
  },
  {
    field: 'workNature',
    title: '工作性质',
    type: 'selected',
    isParams: true,
    paramsId: 'NATUREWORK',
    disableEdit: true
  },
  {
    field: 'employeeStatus',
    title: '员工状态',
    type: 'selected',
    isParams: true,
    paramsId: 'EMPLOYEESTATUS',
    disableEdit: true
  },
  {
    field: 'turnoverType',
    title: '异动类型',
    type: 'radio',
    optional: [
      {
        name: '调岗',
        value: '5'
      },
      {
        name: '晋升',
        value: '3'
      },
      {
        name: '降级',
        value: '4'
      }
    ]
  },
  {
    field: 'turnoverCause',
    title: '异动原因',
    type: 'radio',
    optional: [
      {
        name: '工作安排',
        value: '1'
      },
      {
        name: '个人申请',
        value: '2'
      }
    ]
  },
  {
    field: 'originalOrgId',
    title: '原部门',
    type: 'org',
    disableEdit: true
  },
  {
    field: 'targetOrgId',
    title: '变更部门',
    type: 'org',
    init: (form, item) => {
      const params = {
        orgId: form.targetOrgId
      }
      const options = []
      getPositionApi(params).then(response => {
        if (response.success) {
          let data = []
          if (response.data) {
            data = response.data
          }
          data.forEach(v => {
            const a = {
              name: v.postName,
              value: v.postId
            }
            options.push(a)
          })
          changeRosterForm.forEach(v => {
            if (v.field === 'targetPost') {
              v.options = options
            }
          })
        }
      })
    },
    itemChange: (form) => {
      form.targetPostLevel = ''
      form.targetPost = ''
      if (!form.targetOrgId) {
        return
      }
      const params = {
        orgId: form.targetOrgId
      }
      const options = []
      getPositionApi(params).then(response => {
        if (response.success) {
          let data = []
          if (response.data) {
            data = response.data
          }
          data.forEach(v => {
            const a = {
              name: v.postName,
              value: v.postId
            }
            options.push(a)
          })
          changeRosterForm.forEach(v => {
            if (v.field === 'targetPost') {
              v.options = []
              v.options = options
            }
            if (v.field === 'postLevel') {
              v.options = []
            }
          })
        }
      })
    }
  },
  {
    field: 'originalPost',
    title: '原岗位',
    type: 'selected',
    isParams: true,
    paramsId: 'POST',
    disableEdit: true
  },
  {
    field: 'targetPost',
    title: '变更岗位',
    info: '部门、岗位、职级为三级联动：部门 > 岗位 > 职级',
    type: 'selected',
    options: [],
    init: (form, item) => {
      if (form.targetOrgId && form.targetPost) {
        const params = {
          orgId: form.targetOrgId,
          postId: form.targetPost
        }
        const options = []
        getRankApi(params).then(response => {
          if (response.success) {
            if (response.data) {
              response.data.forEach(v => {
                const a = {
                  name: v.name,
                  value: v.id
                }
                options.push(a)
              })
              changeRosterForm.forEach(v => {
                if (v.field === 'targetPostLevel') {
                  v.options = options
                }
              })
            }
          }
        })
      }
    },
    itemChange: (form, item) => {
      form.targetPostLevel = ''
      // console.log(form, item)
      if (form.orgId && form.position) {
        const params = {
          orgId: form.targetOrgId,
          postId: form.targetPost
        }
        const options = []
        getRankApi(params).then(response => {
          if (response.success) {
            if (response.data) {
              response.data.forEach(v => {
                const a = {
                  name: v.name,
                  value: v.id
                }
                options.push(a)
              })
              changeRosterForm.forEach(v => {
                if (v.field === 'targetPostLevel') {
                  v.options = options
                }
              })
            }
          }
        })
      }
    }
  },
  {
    field: 'originalPostLevel',
    title: '原职级',
    type: 'selected',
    isParams: true,
    paramsId: 'RANK',
    disableEdit: true
  },
  {
    field: 'targetPostLevel',
    title: '变更职级',
    info: '部门、岗位、职级为三级联动：部门 > 岗位 > 职级',
    type: 'selected',
    options: []
  },
  {
    field: 'originalWorkAddr',
    title: '原工作地址',
    type: 'selected',
    isParams: true,
    disableEdit: true,
    paramsId: 'WORKPLACE'
  },
  {
    field: 'targetWorkAddr',
    title: '变更工作地址',
    type: 'selected',
    isParams: true,
    paramsId: 'WORKPLACE'
  },
  {
    field: 'originalCompany',
    title: '原合同公司',
    type: 'contract-company',
    disableEdit: true
  },
  {
    field: 'targetCompany',
    title: '变更合同公司',
    type: 'contract-company',
  },
  {
    field: 'effectDate',
    title: '生效日期',
    type: 'date'
  },

  {
    field: 'remarks',
    title: '备注',
    type: 'text'
  }
]

/**
 * 调动的审批
 */
export const turnoverApproveSetting = [{
  field: 'id',
  title: 'id',
  type: 'text',
  hideEdit: true
},
{
  field: 'employeeNo',
  title: '员工',
  type: 'text',
  disableEdit: true
}, {
  field: 'employeeName',
  title: '员工名称',
  type: 'text',
  disableEdit: true
}, {
  field: 'turnoverType',
  title: '异动类型',
  type: 'radio',
  disableEdit: true,
  customText: (item) => {
    switch (item.turnoverType) {
      case '4':
        return '降级'
      case '3':
        return '晋升'
      case '5':
        return '调岗'
    }
  },
  optional: [{
    name: '调岗',
    value: '5'
  },
  {
    name: '晋升',
    value: '3'
  },
  {
    name: '降级',
    value: '4'
  }
  ]
}, {
  field: 'entryDate',
  title: '入职日期',
  type: 'date',
  disableEdit: true
},
{
  field: 'originalOrgId',
  title: '原部门',
  type: 'org',
  disableEdit: true
},

{
  field: 'targetOrgId',
  title: '目标部门',
  type: 'org',
  init: (form, item) => {
    const params = {
      orgId: form.targetOrgId
    }
    const options = []
    getPositionApi(params).then(response => {
      if (response.success) {
        let data = []
        if (response.data) {
          data = response.data
        }
        data.forEach(v => {
          const a = {
            name: v.postName,
            value: v.postId
          }
          options.push(a)
        })
        turnoverApproveSetting.forEach(v => {
          if (v.field === 'targetPost') {
            v.options = options
          }
        })
      }
    })
  },
  itemChange: (form, b, c) => {
    const params = {
      orgId: form.targetOrgId
    }
    const options = []
    getPositionApi(params).then(response => {
      if (response.success) {
        let data = []
        if (response.data) {
          data = response.data
        }
        data.forEach(v => {
          const a = {
            name: v.postName,
            value: v.postId
          }
          options.push(a)
        })
        turnoverApproveSetting.forEach(v => {
          if (v.field === 'targetPost') {
            v.options = []
            form.targetPost = ''
            v.options = options
          }
          if (v.field === 'targetPostLevel') {
            form.targetPostLevel = ''
          }
        })
      }
    })
  }
},


{
  field: 'originalPost',
  title: '原岗位',
  type: 'text',
  disableEdit: true
},
{
  field: 'targetPost',
  title: '目标岗位',
  type: 'selected',
  options: [],
  init: (form, item) => {
    if (form.targetOrgId && form.targetPost) {
      const params = {
        orgId: form.targetOrgId,
        postId: form.targetPost
      }
      const options = []
      getRankApi(params).then(response => {
        if (response.success) {
          if (response.data) {
            response.data.forEach(v => {
              const a = {
                name: v.name,
                value: v.id
              }
              options.push(a)
            })

            turnoverApproveSetting.forEach(v => {
              if (v.field === 'targetPostLevel') {
                v.options = options
              }
            })
          }
        }
      })
    }
  },
  itemChange: (form, item) => {
    if (form.targetOrgId && form.targetPost) {
      const params = {
        orgId: form.targetOrgId,
        postId: form.targetPost
      }
      const options = []
      getRankApi(params).then(response => {
        if (response.success) {
          if (response.data) {
            response.data.forEach(v => {
              const a = {
                name: v.name,
                value: v.id
              }
              options.push(a)
            })

            turnoverApproveSetting.forEach(v => {
              if (v.field === 'targetPostLevel') {
                form.targetPostLevel = ''
                v.options = options
              }
            })
          }
        }
      })
    }
  }
},
{
  field: 'originalPostLevel',
  title: '原职级',
  type: 'selected',
  isParams: true,
  paramsId: 'RANK',
  disableEdit: true
},

{
  field: 'targetPostLevel',
  title: '目标职级',
  type: 'selected',
  options: []
},
{
  field: 'originalSalary',
  title: '原薪资',
  type: 'text',
  disableEdit: true
}, {
  field: 'targetSalary',
  title: '目标薪资',
  type: 'text'
}, {
  field: 'originalBaseSalary',
  title: '原基本底薪',
  type: 'text',
  disableEdit: true
}, {
  field: 'targetBaseSalary',
  title: '目标基本底薪',
  type: 'text'
}, {
  field: 'originalPostSalary',
  title: '原岗位工资',
  type: 'text',
  disableEdit: true
}, {
  field: 'targetPostSalary',
  title: '目标岗位工资',
  type: 'text'
},
{
  field: 'originalAllowance',
  title: '原岗位津贴',
  type: 'text',
  disableEdit: true
}, {
  field: 'targetAllowance',
  title: '目标岗位津贴',
  type: 'text'
}, {
  field: 'originalAchievementBonus',
  title: '原绩效奖金',
  type: 'text',
  disableEdit: true
}, {
  field: 'targetAchievementBonus',
  title: '目标绩效奖金',
  type: 'text'
}, {
  field: 'originalFullattendReward',
  title: '原全勤奖',
  type: 'text',
  disableEdit: true
}, {
  field: 'targetFullattendReward',
  title: '目标全勤奖',
  type: 'text'
}, {
  field: 'originalOtherReward',
  title: '原其他',
  type: 'text',
  disableEdit: true
}, {
  field: 'targetOtherReward',
  title: '其他',
  type: 'text'
}, {
  field: 'effectDate',
  title: '生效日期',
  type: 'date'
},
{
  field: 'approvalOpinion',
  title: '审批意见',
  type: 'textarea',
  onlyRow: true
},


{
  field: 'taskId',
  title: 'taskId',
  type: 'text',
  disableEdit: true,
  hideEdit: true
},
{
  field: 'action',
  title: 'action',
  type: 'text',
  disableEdit: true,
  hideEdit: true
},
{
  field: 'taskDefKey',
  title: 'taskDefKey',
  type: 'text',
  disableEdit: true,
  hideEdit: true
},
{
  field: 'procInstId',
  title: 'procInstIdww',
  type: 'text',
  disableEdit: true,
  hideEdit: true
}
]



/**
 * 离职的list
 */
export const leaveListSetting = [{
  field: 'id',
  title: 'id',
  type: 'text',
  isHiden: true
},
{
  field: 'employeeNo',
  title: '员工编号',
  type: 'text'
},
{
  field: 'employeeName',
  title: '员工名称',
  type: 'text'
},
{
  field: 'lastWorkDate',
  title: '计划离职日期',
  type: 'date'
},
{
  field: 'leaveApplyDate',
  title: '申请日期',
  type: 'date'
},
{
  field: 'salarySettledDate',
  title: '薪资结算日期',
  type: 'date'
},
{
  field: 'leaveReason',
  title: '离职原因',
  type: 'text'
},
{
  field: 'statusName',
  title: '状态',
  type: 'text'
},
{
  field: 'status',
  title: '状态',
  type: 'text',
  isHiden: true
},
{
  field: 'taskDefKey',
  title: 'taskDefKey',
  type: 'text',
  isHiden: true
}
]



/**
 * 离职的详情
 */
export const leaveDetailSetting = [{
  field: 'id',
  title: 'id',
  type: 'text',
  hideDetail: true
},
{
  field: 'employeeNo',
  title: '员工',
  type: 'text',
  disableEdit: true
}, {
  field: 'employeeName',
  title: '员工名称',
  type: 'text'
}, {
  field: 'workNature',
  title: '工作性质',
  type: 'selected',
  isParams: true,
  paramsId: 'NATUREWORK'
},

{
  field: 'constractCompany',
  title: '合同公司',
  type: 'contract-company'
},
{
  field: 'targetWorkAddr',
  title: '工作地点',
  type: 'selected',
  isParams: true,
  paramsId: 'WORKPLACE'
},
{
  field: 'entryDate',
  title: '入职日期',
  type: 'date'
}, {
  field: 'employeeStatus',
  title: '员工状态',
  type: 'selected',
  isParams: true,
  paramsId: 'EMPLOYEESTATUS'
},

{
  field: 'companyEmail',
  title: '工作邮箱',
  type: 'email'
}, {
  field: 'leaveApplyDate',
  title: '申请日期',
  type: 'date'
}, {
  field: 'taskDefName',
  title: '状态',
  type: 'text',
  disableEdit: true
}, {
  field: 'lastWorkDate',
  title: '计划离职日期',
  type: 'date'
},

{
  field: 'salarySettledDate',
  title: '薪资结算日期',
  type: 'date'
},
{
  field: 'leaveReason',
  title: '离职原因',
  type: 'text'
},
{
  field: 'remarks',
  title: '备注',
  type: 'textarea'
},
{
  field: 'attachId',
  title: '附件',
  type: 'text'
}
]


/**
 * 离职的审批
 */
export const leaveApproveSetting = [{
  field: 'id',
  title: 'id',
  type: 'text',
  hideEdit: true
},
{
  field: 'employeeNo',
  title: '员工',
  type: 'text',
  disableEdit: true
}, {
  field: 'employeeName',
  title: '员工名称',
  type: 'text',
  disableEdit: true
}, {
  field: 'workNature',
  title: '工作性质',
  type: 'selected',
  isParams: true,
  paramsId: 'NATUREWORK',
  disableEdit: true
},

{
  field: 'constractCompany',
  title: '合同公司',
  type: 'contract-company',
  disableEdit: true
},
{
  field: 'targetWorkAddr',
  title: '工作地点',
  type: 'selected',
  isParams: true,
  paramsId: 'WORKPLACE'
},
{
  field: 'entryDate',
  title: '入职日期',
  type: 'date',
  disableEdit: true
}, {
  field: 'employeeStatus',
  title: '员工状态',
  type: 'selected',
  isParams: true,
  paramsId: 'EMPLOYEESTATUS',
  disableEdit: true
},

{
  field: 'companyEmail',
  title: '工作邮箱',
  type: 'text',
  disableEdit: true
},
{
  field: 'taskDefName',
  title: '状态',
  type: 'text',
  disableEdit: true
},
{
  field: 'leaveApplyDate',
  title: '离职申请日期',
  type: 'date'
},
{
  field: 'lastWorkDate',
  title: '计划离职日期',
  type: 'date'
},
{
  field: 'isSalarySettled',
  title: '工资是否结算',
  type: 'radio',
  optional: [
    {
      name: '是',
      value: '1'
    },
    {
      name: '否',
      value: '0'
    }
  ]
},
{
  field: 'salarySettledDate',
  title: '薪资结算日期',
  type: 'date'
},
{
  field: 'leaveReason',
  title: '离职原因',
  type: 'text'
},

{
  field: 'attachId',
  title: '简历',
  type: 'file',
  disableEdit: true,
  busiKey: 'employeeNo'
},
{
  field: 'taskId',
  title: 'taskId',
  type: 'text',
  disableEdit: true,
  hideEdit: true
},
{
  field: 'action',
  title: 'action',
  type: 'text',
  disableEdit: true,
  hideEdit: true
},
{
  field: 'taskDefKey',
  title: 'taskDefKey',
  type: 'text',
  disableEdit: true,
  hideEdit: true
},
{
  field: 'procInstId',
  title: 'procInstIdww',
  type: 'text',
  disableEdit: true,
  hideEdit: true
}
]










































export const setting = [{
  field: 'reqId',
  title: '编号',
  type: 'text'

},
{
  field: 'reqName',
  title: '名称',
  type: 'text'
},
{
  field: 'orgId',
  title: '部门',
  type: 'org'
},
{
  field: 'position',
  title: '招聘岗位',
  type: 'text',
  isParams: true, // 默认为false，当isParams 为true 时，下拉数据为参数类型，
  paramsId: 'POST',
  searchable: true
},
{
  field: 'educationRequire',
  title: '学历要求',
  type: 'text',
  isParams: true, // 默认为false，当isParams 为true 时，下拉数据为参数类型，
  paramsId: 'EDUCATION',
},
{
  field: 'recruitsNumbers',
  title: '招聘人数',
  type: 'text'
},
{
  field: 'entryNumbers',
  title: '已入职人数',
  type: 'text'
},
{
  field: 'recruitsProgress', // 自定义
  title: '招聘进度',
  type: 'text'
},
{
  field: 'responsiblePerson',
  title: '负责人',
  type: 'text',
  isParams: true, // 默认为false，当isParams 为true 时，下拉数据为参数类型，
  paramsId: 'POST',
},
{
  field: 'startDate',
  title: '启动日期',
  type: 'date'
},
{
  field: 'status', // 自定义
  title: '状态',
  type: 'text'
}
]
/**
 * 详情的set
 */
export const detailSetting = [{
  field: 'reqId',
  title: '编号',
  type: 'text',
  hideDetail: true,
  searchable: true
},
{
  field: 'reqName',
  title: '需求名称',
  type: 'text',
  searchable: true

},
{
  field: 'planId',
  title: '招聘规划',
  type: 'selectbyurl',
  url: '/dropdownlists/selectPlanList'
},
{
  field: 'orgId',
  title: '所属部门',
  type: 'org',
  searchable: true
},
{
  field: 'position',
  title: '岗位名称',
  type: 'selected',
  isParams: true, // 默认为false，当isParams 为true 时，下拉数据为参数类型，
  paramsId: 'POST',
  searchable: true
},
{
  field: 'recruitsNumbers',
  title: '招聘人数',
  type: 'text'
},
{
  field: 'workCity',
  title: '工作城市',
  type: 'text'
},
{
  field: 'workNature',
  title: '工作性质',
  type: 'selected',
  isParams: true, // 默认为false，当isParams 为true 时，下拉数据为参数类型，
  paramsId: 'NATUREWORK'
},
{
  field: 'workExperienceRequire',
  title: '工作经验要求',
  type: 'selected',
  isParams: true, // 默认为false，当isParams 为true 时，下拉数据为参数类型，
  paramsId: 'EXPERIENCEWORK'
},
{
  field: 'educationRequire',
  title: '学历要求',
  type: 'selected',
  isParams: true, // 默认为false，当isParams 为true 时，下拉数据为参数类型，
  paramsId: 'EDUCATION'
},
{
  field: 'startingSalary',
  title: '起始薪资',
  type: 'text'
},
{
  field: 'topSalary',
  title: '最高薪资',
  type: 'text'
},
{
  field: 'startDate',
  title: '启动日期',
  type: 'date'
},
{
  field: 'endDate',
  title: '最晚入职日期',
  type: 'date'
},
{
  field: 'responsiblePerson',
  title: '负责人',
  type: 'text',
  isParams: true, // 默认为false，当isParams 为true 时，下拉数据为参数类型，
  paramsId: '1',
},
{
  field: 'postRequire',
  title: '岗位要求',
  type: 'text'
},
{
  field: 'workRequire',
  title: '任职资格',
  type: 'text'
},
{
  field: 'recruitsReason',
  title: '招聘原因',
  type: 'text'
}, {
  field: 'status',
  title: '状态',
  type: 'text',
  hideEdit: true
},
]
/**
 * 停止招聘set
 */
export const stopSetting = [{
  field: 'stopReason',
  title: '停止招聘原因',
  type: 'text'
}]
